﻿Public Class ViewA
    Inherits System.Web.UI.Page
    Private Shared prevPage As String = String.Empty

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Not IsPostBack) Then
            prevPage = Request.UrlReferrer.ToString()
        End If
    End Sub

    Protected Sub backButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles backButton.Click
        'go back a page
        Response.Redirect(prevPage)
    End Sub

    Protected Sub editButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles editButton.Click
        Response.Redirect("EditWorkshopA.aspx")
    End Sub

    Protected Sub deleteButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles deleteButton.Click

        'SQL delete from workshop
        Dim id As String

        id = Request.QueryString("id")

        SqlDataSource4.DeleteParameters("ID").DefaultValue = id

        SqlDataSource4.Delete()


        Response.Redirect("ManageWorkshops.aspx")

    End Sub

     
End Class